<template>
  <a-modal v-model="visible" :footer="null" :title="title" width="40%">
    <a-spin :spinning="confirmSpin">
      <a-form-model
        ref="form"
        :model="configData"
        :rules="rules"
        :label-col="labelCol"
        :wrapper-col="wrapperCol">

        <a-form-model-item label="appId" prop="appId">
          <a-input v-model="configData.appId" placeholder="请输入 appId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="appSecret" prop="appSecret">
          <a-input v-model="configData.appSecret" placeholder="请输入 appSecret" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="mchId" prop="mchId">
          <a-input v-model="configData.mchId" placeholder="请输入 mchId" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="partnerKey" prop="partnerKey">
          <a-input v-model="configData.partnerKey" placeholder="请输入 partnerKey" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="certPath" prop="certPath">
          <a-input v-model="configData.certPath" placeholder="请输入 certPath" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item label="domain" prop="domain">
          <a-input v-model="configData.domain" placeholder="请输入 domain" :style="disable?{color:'black'}:{}"
                   :disabled="disable"/>
        </a-form-model-item>

        <a-form-model-item :wrapper-col="{ span: 14, offset: 7 }" v-if="!disable">
          <a-button type="primary" style="width:100px;" @click="onSubmit">
            修改
          </a-button>
          <a-button style="margin-left: 20px;width:100px;" @click="resetForm">
            重置
          </a-button>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
  </a-modal>
</template>
<script>
import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";

export default {
  name: "WxPayModal",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  data() {
    return {
      description: "微信支付-APP 公众号 小程序通用",
      configData: {
        appId: "",
        appSecret: "",
        mchId: "",
        partnerKey: "",
        certPath: "",
        domain: "",
      },
      rules: {
        appId: [
          {required: true, message: '请输入 appId', trigger: 'blur'},
        ],
        appSecret: [
          {required: true, message: '请输入 appSecret', trigger: 'blur'},
        ],
        mchId: [
          {required: true, message: '请输入 mchId', trigger: 'blur'},
        ],
        partnerKey: [
          {required: true, message: '请输入 partnerKey', trigger: 'blur'},
        ],
        certPath: [
          {required: true, message: '请输入 certPath', trigger: 'blur'},
        ],
        domain: [
          {required: true, message: '请输入 domain', trigger: 'blur'},
        ],
      },
      type: "",
      title: "",
      url: {
        configUpdate: "",
      }
    }
  },
}
</script>

<style scoped>

</style>